#pragma once
#include "business.h"

// 登陆业务
class LoginBusiness : public Business
{
public:
    LoginBusiness() {}
    ~LoginBusiness() override {}
    virtual CWHttpReply doBusiness(CWHttpRequest &) override;
    bool handleBody(CWHttpRequest &);
    std::string doSql();
    int makeToken();
    bool saveToken(int);
    std::string getSaveUserName(int);
    // 如果返回-1表示未登录
    int checkUserLogined();

private:
    unsigned short m_statuscode;
    std::string m_id;
    std::string m_pwd;
    std::string m_name;
    std::string m_body;
};